package com.gdut.huayan.entity.po;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.gdut.huayan.validation.group.GroupAdd;
import com.gdut.huayan.validation.group.GroupUpdate;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;


@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "t_festival",autoResultMap = true)
public class Festival implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @Null(groups = {GroupAdd.class})
    @NotNull(groups = {GroupUpdate.class})
    private Long id;

    /**
     * 页面json：css --> json
     * JSONObject --> json
     */
    // @TableField(typeHandler = FastjsonTypeHandler.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<JSONObject> pageJson;

    /**
     * 主标题
     */
    @NotBlank(groups = {GroupAdd.class},message = "节日标题不能为空")
    private String mainTitle;

    /**
     * 是否显示在标题栏
     */
    private Integer showNavigate;

    /**
     * 副标题
     */
    private String subtitle;

    /**
     * 简介一标题
     */
    private String infoTitleOne;

    /**
     * 简介二标题
     */
    private String infoTitleTwo;

    /**
     * 简介一
     */
    private String infoOne;

    /**
     * 简介二
     */
    private String infoTwo;

    /**
     * 封面图片
     */
    private Long coverFileId;

    /**
     * 背景图
     */
    private Long backgroundFileId;

    /**
     * 开始时间
     */
    @NotNull(groups = {GroupAdd.class},message = "请输入开始时间")
    private LocalDateTime startTime;

    /**
     * 截止时间
     */
    @NotNull(groups = {GroupAdd.class},message = "请输入结束时间")
    private LocalDateTime endTime;

    /**
     * 创建用户
     */
        private Long createUser;


}
